package Tax;

import java.util.Scanner;

public class taxCost {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你乘坐的出租车类型:1.夏利2：富士康3：桑塔纳");
        int type= scanner.nextInt();
        System.out.println("请输入你行驶的距离");
        int kilometer= scanner.nextInt();
        double money,money1;
       switch (type){
           case 1: if (kilometer>3){
               money=3+(kilometer-3)*2.1;
               money1=money*100/100.0;
               System.out.print("你乘坐的出租车是夏利,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money1);
                }else{
               money=3;
               System.out.print("你乘坐的出租车是夏利,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money);
               }break;
           case 2:if (kilometer>3){
               money=4+(kilometer-3)*2.4;
               money1=money*100/100.0;
               System.out.print("你乘坐的出租车是富士康,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money1);
           }else {
               money=3;
               System.out.print("你乘坐的出租车是富士康,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money);
           }break;
           case 3:if (kilometer>3){
               money=5+(kilometer-3)*2.7;
               money1=money*100/100.0;
               System.out.print("你乘坐的出租车是桑塔纳,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money);
           }else {
               money=3;
               System.out.print("你乘坐的出租车是桑塔纳,本次行驶的路程为："+kilometer);
               System.out.print("\t\t总费用是： " + money);
           }break;
           case 4: System.out.println("出租车坏了，免单");
       }





    }
}
